/**
 * 
 */
package observers.observers.impl;


import observers.interfaces.DisplayElement;
import observers.observers.Observer;
import observers.subject.Subject;

/**
 * @author hoannguyen
 *
 */
public class WeatherDisplayer2 implements Observer, DisplayElement{

	private String data;
	private Subject weatherData;
	
	public WeatherDisplayer2(Subject weatherData) {
		this.weatherData = weatherData;
		this.weatherData.registerObserver(this);
	}

	@Override
	public void display() {
		System.out.println("WeatherDisplayer2::" + data);
	}

	@Override
	public void update(Object data) {
		this.data = (String) data;
		display();
	}

}
